/**
 * @file lv_demo_music_main.h
 *
 */

#ifndef LV_DEMO_MUSIC_MAIN_H
#define LV_DEMO_MUSIC_MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
 *      INCLUDES
 *********************/
#include "lv_demo_music.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <pthread.h>
#include <stdbool.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>

#if LV_USE_DEMO_MUSIC

#if LV_USE_GRID == 0
#error "LV_USE_GRID needs to be enabled"
#endif

/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/

/**********************
 * GLOBAL PROTOTYPES
 **********************/
lv_obj_t * lv_demo_music_main_create(lv_obj_t * parent);
extern lv_timer_t  * sec_counter_timer;
extern lv_obj_t * spectrum_obj;
extern pthread_t tid;
extern bool playing;
extern bool music_flag;
extern uint32_t spectrum_i;
extern uint32_t spectrum_i_pause;
extern uint32_t time_act;
extern bool start_anim;
void start_anim_cb(void * var, int32_t v);
void spectrum_anim_cb(void * a, int32_t v);
void lv_demo_music_play(uint32_t id);
void lv_demo_music_resume(void);
void lv_demo_music_pause(void);
void lv_demo_music_album_next(bool next);


// extern char title_list[14][50];
extern int current_num;
void format_time(float seconds, char *time_str);
void parse_mplayer_response(const char *response);
void safe_kill_mplayer();

/**********************
 *      MACROS
 **********************/
#endif /*LV_USE_DEMO_MUSIC*/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*LV_DEMO_MUSIC_MAIN_H*/
